home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / think / AmiChess.lha / AmiChess / src / inlines.h < prev    next >
C/C++ Source or Header  |  2002-10-13  |  508b  |  26 lines

  1. #ifndef INLINES_H
  2. #define INLINES_H
  3.  
  4. #ifdef __STORM__
  5. __inline unsigned char leadz(BitBoard b)
  6. #else
  7. static inline unsigned char leadz(BitBoard b)
  8. #endif
  9. {
  10. if(b>>48) return lzArray[b>>48];
  11. if(b>>32) return lzArray[b>>32]+16;
  12. if(b>>16) return lzArray[b>>16]+32;
  13. return lzArray[b]+48;
  14. }
  15.  
  16. #ifdef __STORM__
  17. __inline unsigned char nbits(BitBoard b)
  18. #else
  19. static inline unsigned char nbits(BitBoard b)
  20. #endif
  21. {
  22. return BitCount[b>>48]+BitCount[(b>>32)&0xffff]+BitCount[(b>>16)&0xffff]+BitCount[b&0xffff];
  23. }
  24.  
  25. #endif
  26.